﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Forms.Integration;
using System.Windows.Controls.Primitives;

namespace WpfBinding
{
    /// <summary>
    /// ErrorBindings.xaml 的交互逻辑
    /// </summary>
    public partial class ErrorBindings : Page
    {
        public ErrorBindings()
        {
            InitializeComponent();

            Loaded += new RoutedEventHandler(ErrorBindings_Loaded);
        }
        private AxWMPLib.AxWindowsMediaPlayer axWindowsMediaPlayer1;
        void ErrorBindings_Loaded(object sender, RoutedEventArgs e)
        {
            axWindowsMediaPlayer1 = new AxWMPLib.AxWindowsMediaPlayer();
            ((System.ComponentModel.ISupportInitialize)(this.axWindowsMediaPlayer1)).BeginInit();
            windowsFormsHost1.Child = axWindowsMediaPlayer1;
            ((System.ComponentModel.ISupportInitialize)(this.axWindowsMediaPlayer1)).EndInit();
            axWindowsMediaPlayer1.enableContextMenu = false;

            axWindowsMediaPlayer1.URL = @"C:\Users\Public\Videos\Sample Videos\Wildlife.wmv";
            axWindowsMediaPlayer1.Ctlcontrols.play();
        }
    }
}
